import 'package:self32/generated/json/base/json_field.dart';
import 'package:self32/generated/json/book_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class BookEntity {

	String? no;
	String? uid;
	String? place;
	@JSONField(name: "state_value")
	String? stateValue;
	String? isbn;
	@JSONField(name: "main_title")
	String? mainTitle;
	String? author;
	@JSONField(name: "search_no")
	String? searchNo;
	String? subject;
	String? publisher;
	@JSONField(name: "publish_date")
	String? publishDate;
	@JSONField(name: "return_time")
	String? returnTime;
	@JSONField(name: "ready_return_date")
	String? readyReturnDate;

	String? error;
	bool isQr = false;
	bool isScan = false;
	bool force = false;

	//2=已借阅或已归还  1=借阅或归还成功 0=未借阅或未归还 -1 = 借阅失败或归还失败
	int state = 0;

  BookEntity();

  factory BookEntity.fromJson(Map<String, dynamic> json) => $BookEntityFromJson(json);

  Map<String, dynamic> toJson() => $BookEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}